import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsInt, IsUrl, IsOptional } from 'class-validator';

export class CreateCatDto {
  @ApiProperty({ example: 'Whiskers', description: '猫咪的名字' })
  @IsString()
  name: string;

  @ApiProperty({ example: 3, description: '猫咪的年龄' })
  @IsInt()
  age: number;

  @ApiProperty({
    example: '波斯猫',
    description: '猫咪的品种',
    required: false,
  })
  @IsString()
  @IsOptional()
  breed?: string;

  @ApiProperty({
    example: 'https://example.com/cat.jpg',
    description: '猫咪的照片URL',
    required: false,
  })
  @IsUrl()
  @IsOptional()
  imageUrl?: string;
}
